<layout name="popup" />
<block name="content">
	<input type="hidden" name="ajax" id="ajax" value="1">
	<select name="dept_list" id="dept_list" class="hidden">
		{:fill_option($dept_list)}
	</select>
	<div class="popup-header">
		<h1>添加员工</h1>
		<i class="mid"></i>
		<a class="btn btn-normal" onclick="save();">确定</a>
		<a class="btn btn-return" onclick="close_popup();">取消</a>
	</div>
	<div class="popup-body">
		<div class="popup-body-scroll">
			<div class="popup-content">
				<form id="form_data" name="form_data" method="post" >
					<input type="hidden" name="opmode" id="opmode" value="add">
					<div class="box">
						<label class="input-label">员工编号*：</label>
						<input class="input w19" type="text" id="emp_no" name="emp_no"  check="required" info="请输入员工编号" >
					</div>
					<div class="box">
						<label class="input-label">姓名*：</label>
						<input class="input w19" type="text" id="name" name="name"  check="required" info="请输入姓名" >
					</div>
					<div class="layui-sub-form-item hidden">
						<label class="input-label">昵称*：</label>
						<input class="input w19" type="text" id="nickname" name="nickname" >
					</div>
					<div class="box">
						<label class="input-label">性别*：</label>
						<select name="sex" id="sex" class="select w10">
							<option  value="male">男</option>
							<option value="female">女</option>
						</select>
						<i class="icon"></i>
					</div>
					<div class="box">
						<label class="input-label">生日*：</label>
						<input  type="text" id="birthday" name="birthday"  class="input-date input" >
					</div>
					<div class="box">
						<label class="input-label">部门*：</label>
						<div class="input-box w19">
							<input name="dept_id" id="dept_id" type="hidden" />
							<input class="input" name="dept_name"  id="dept_name" type="text" info="请选择部门" check="required"  />
							<a class="add-on w4" onclick="select_dept()"><i class="fa fa-search" ></i></a>
						</div>
					</div>
					<div class="box">
						<label class="input-label">职位*：</label>
						<select name="position_id" id="position_id" class="select w19" info="请选择职位" check="required">
							<option value="">选择职位</option>
							{:fill_option($position_list)}
						</select>
						<i class="icon"></i>
					</div>
					<div class="box">
						<label class="input-label">办公座机*：</label>
						<input type="text" id="office_tel" name="office_tel" class="input w19">
					</div>
					<div class="box">
						<label class="input-label">移动电话*：</label>
						<input type="text" id="mobile_tel" name="mobile_tel" class="input w19">
					</div>
					<div class="box">
						<label class="input-label">电子邮箱*：</label>
						<div class="input-inline">
							<input type="text" id="email" name="email" class="input">
						</div>
					</div>
					<div class="box">
						<label class="input-label">负责业务*：</label>
						<input type="text" id="duty" name="duty" class="input">
					</div>
					<div class="box">
						<label class="input-label">状态*：</label>
						<select class="select w10"  name="is_del" id="is_del">
							<option  value="0">启用</option>
							<option value="1">禁用</option>
						</select>
						<i class="icon"></i>
					</div>
					<p class="text-right">
						带*项为必填选项
					</p>
				</form>
			</div>
		</div>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		var index = parent.layer.getFrameIndex(window.name);
		layui.use(['global'], function() {
			var fn = {
				save : function() {
					send_form('form_data', '{:url("save")}', '', function(ret) {
						if (ret.status == 1) {
							parent.layer.msg(ret.info, {
								time : 1200
							}, function() {
								parent.layer.close(index);
								parent.location.reload(true);
							});
						} else {
							parent.layer.msg(ret.info);
							return false;
						};
					});
				},
				close_popup : function() {
					parent.layer.close(index);
				},
				select_dept : function() {
					winopen("{:url('select_dept')}", 560, 470);
				},
			};
			win_exp(fn);
		});

	</script>
</block>